package cn.z2huo.knowledge.basic.bigdecimal;

import java.math.BigDecimal;
import java.math.RoundingMode;

/**
 * <p>
 *
 * @author z2huo
 */
public class DivideTest {

    public static void main(String[] args) {

        BigDecimal num_10 = new BigDecimal("10");
        BigDecimal num_11 = new BigDecimal("1.1");

        System.out.println(num_10.divide(num_11, 10, RoundingMode.HALF_UP));
        System.out.println(num_10.multiply(new BigDecimal("0.11")));
        System.out.println(num_10.divide(num_11, 10, RoundingMode.HALF_UP).multiply(new BigDecimal("0.11")));
        System.out.println(num_10.multiply(new BigDecimal("0.11")).divide(num_11, 10, RoundingMode.HALF_UP));

        System.out.println(num_10.divide(num_11, 10, RoundingMode.HALF_UP).multiply(new BigDecimal("0.11")).setScale(10, RoundingMode.HALF_UP));
    }

}
